home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / textCurvesSet.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.5 KB  |  88 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  August 14, 1996
  22. //  Author:         ms
  23. //
  24. //  Description:
  25. //      Create text using the option box defaults.
  26. //
  27. //  Input Arguments:
  28. //      The string.
  29. //
  30. //  Return Value:
  31. //      None.
  32. //
  33.  
  34. global proc textCurvesSet(
  35.      int $dohistory,
  36.     int $dohow,
  37.     string $dofont,
  38.     string $text )
  39. {
  40.     string $textDag[], $letters[], $curves[];
  41.     string $results, $tmp[], $name, $tmpCmd;
  42.     int $i, $n;
  43.     int $historyOnTextCurvesNeeded = 0;
  44.  
  45.     // replace any \ by \\ and " by \" in the string so that the command will
  46.     // create the \ and " as well
  47.     //
  48.     string $totalText = substituteAllString( $text, "\\", "\\\\" );
  49.     $totalText = substituteAllString( $totalText, "\"", "\\\"" );
  50.  
  51.     string $cmd = "textCurves -ch " + $historyOnTextCurvesNeeded +
  52.         " -f \"" + $dofont + "\" -t \"" + $totalText + "\"";
  53.     if ( catch( $textDag = evalEcho($cmd) ) )
  54.     {
  55.         // if textCurves failed then no need to continue since nothing was
  56.         // created
  57.         return;
  58.     }
  59.  
  60.     if( ! $dohow ) {
  61.         select -r $textDag[0];
  62.         return;
  63.     }
  64.  
  65.     $letters = `listRelatives -c $textDag[0]`;
  66.  
  67.     float $tol = `optionVar -q positionalTolerance`;
  68.     $n = size( $letters );
  69.     for( $i=0; $i<$n; $i++ ) {
  70.         $name = ("Trim " + $letters[$i] + " #");
  71.         $tmpCmd = "planarSrf -name \"" + $name + "\" -ch " +
  72.             $dohistory + " -tol " + $tol + " -o on -po " + ($dohow == 2) + " " + $letters[$i];
  73.          $tmp = evalEcho( $tmpCmd );
  74.         if( "" == $results ) {
  75.             $results = `group -n ("Trim " + $textDag[0] + " #") $tmp[0]`;
  76.         }
  77.         else {
  78.             parent $tmp[0] $results;
  79.         }
  80.     }
  81.  
  82.     if( ! $dohistory ) {
  83.         delete $textDag[0];
  84.     }
  85.     select -r $results;
  86. }
  87.  
  88.